package org.easyexcel.Controller;


import org.easyexcel.Server.DataExport;
import org.easyexcel.Dao.JdbcBatchDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author DPF
 */
@RestController
@RequestMapping("/api")
public class MyController {
    private final JdbcBatchDao myService;
    @Autowired
    private DataExport dataExport;

    @Autowired
    public MyController(JdbcBatchDao myService) {
        this.myService = myService;
    }

    @GetMapping
    public List<Map<String, Object>> getUsers() {
        return myService.getUsers();
    }
//    @GetMapping("/download")
//    public List<MyEntity> download(HttpServletResponse response ) {
//        return dataExport.dataExport300w(response);
//    }

}
